import 'package:flutter/material.dart';
import 'package:flutter_charge/main.dart';

class PicDetail extends StatefulWidget {
  const PicDetail({Key? key}) : super(key: key);

  @override
  _ArticleDetailState createState() => _ArticleDetailState();
}

class _ArticleDetailState extends State<PicDetail> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: const Text('图片详情'),
        ),
        body: Center(
            child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            const Text("图片内容"),
            ElevatedButton(
                onPressed: () {
                  Navigator.of(context).pushAndRemoveUntil(MaterialPageRoute(builder: (BuildContext context){
                    return const HomePage();
                  }),(route)=>false);
                },
                child: const Text('清空页面栈后，推入新页面'))
          ],
        )));
  }
}
